package com.zjitc.redis;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/10 15:44
 * @description:
 */
public class MyRedis {/*

  private JedisPool jedisPool;

  public MyRedis(JedisPool pool) {
    this.jedisPool = pool;
  }

  public void hset(String key,String field,String value){
    Jedis jedis = null;
    try {
      Jedis con = this.jedisPool.getResource();
      con.hset(key, field, value);
    }finally {
      this.jedisPool.returnResource(jedis);
    }
  }
  public void set(String key,String value){
    Jedis jedis = null;
    try {
      Jedis con  = this.jedisPool.getResource();
      con.set(key,  value);
    }catch (Exception e){
      System.out.println("defeat");
    }
  }
  public String  get(String key){
    Jedis jedis = null;
    try{
      Jedis con = this.jedisPool.getResource();
      System.out.println(con.get(key));
      return con.get(key);

    }finally {
      this.jedisPool.returnResource(jedis);
    }
  }
*/


}
